package stateDiagram.figures;

import static org.jhotdraw.draw.AttributeKeys.TEXT;



import org.jhotdraw.draw.TextFigure;

import stateDiagram.EntityObjects.Event;
import stateDiagram.EntityObjects.StateEntity;

public class EventTextFigure extends TextFigure {
	
		
		private Event event;
		
		public EventTextFigure(Event event){
			super();
			
			this.event = event;
		}
		
		public void setText(String newText) {
			String previousContents = getText();
			willChange();
			if(newText != null){
				if (previousContents !=null && ! previousContents.equals(newText)){
					event.setName(newText);
				}
			
	        super.set(TEXT, newText);
	        changed();
			}
			else{super.set(TEXT, newText);}
	    }
	}


